package cn.kgc.itrip.search.controller;

import cn.kgc.itrip.beans.common.ServerResponse;
import cn.kgc.itrip.beans.model.vo.SearchHotCityVO;
import cn.kgc.itrip.beans.model.vo.SearchHotelVO;
import cn.kgc.itrip.search.service.ISearchService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @author 阿泽
 */
@Controller
@RequestMapping("/api/hotellist")
public class HotellistController {
    /**
     * 根据热门城市查询酒店
     * POST /api/hotellist/searchItripHotelListByHotCity
     */
    @Resource
    private ISearchService iSearchService;

    @RequestMapping(value = "/searchItripHotelListByHotCity",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse searchItripHotelListByHotCity(@RequestBody SearchHotCityVO searchHotCityVO){
       return iSearchService.searchItripHotelListByHotCity(searchHotCityVO);
    }
    /**
     * SearchHotelVO
     *  查询酒店分页
     * POST /api/hotellist/searchItripHotelPage
     */
    @RequestMapping(value = "/searchItripHotelPage",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse searchItripHotelPage(@RequestBody SearchHotelVO searchHotelVO){
        return iSearchService.searchItripHotelPage(searchHotelVO);
    }
}
